/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.factory;

/**
 *
 * 工厂模式（开放-封闭原则）：不同的需求由不同的工厂来创建类
 * 与简单工厂的区别：不修改工厂，而是通过增加抽象工厂的子类
 * @author caicongyang1
 * @version id: FactoryClientTest, v 0.1 17/5/4 下午8:05 caicongyang1 Exp $$
 */
public class FactoryClientTest {
    public static void main(String[] args) {
        IFactory factory = new AddFactory();
        Operation operation = factory.createOperation();
        operation.setNumberB(6);
        operation.setNumberA(7);
        double result = operation.getResult();
        System.out.println(result);
    }
}
